package com.cq.hd.app.controller;

import com.cq.hd.common.annotation.LoginUser;
import com.cq.hd.common.entity.AppLoginUser;
import com.cq.hd.common.response.Result;
import com.cq.hd.member.api.TbCommissionBillApi;
import com.cq.hd.member.api.dto.CommissionBillDto;
import com.cq.hd.member.api.vo.CommissionBillVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;

@RestController
@RequestMapping("/commissionBill")
@Api(tags = "佣金资金明细相关接口")
public class CommissionBillController {

    @Autowired
    private TbCommissionBillApi commissionBillApi;

    @ApiOperation(value = "佣金资金流水")
    @ApiImplicitParam(name = "commissionBillDto", value = "实体", paramType = "query", dataType = "CommissionBillDto")
    @GetMapping("/list")
    public Result<List<CommissionBillVo>> list(@ApiIgnore @LoginUser AppLoginUser appLoginUser, CommissionBillDto commissionBillDto) {
        commissionBillDto.setUserId(appLoginUser.getUserId());
        return commissionBillApi.listCommissionBill(commissionBillDto);
    }

}
